<?php
class User_Model extends ORM {
	protected $belongs_to = array("role");
	protected $has_many = array("news",
						"new_comments",
						"new_images",
						"forum_questions",
						"forum_answers");

	public function unique_key($id = NULL){
		if ( ! empty($id) AND is_string($id) AND ! ctype_digit($id) ){
			return 'username';
		}
		return parent::unique_key($id);
	}
}
?>